package com;

import com.pojo.Menu;
import com.pojo.Test;
import com.service.MenuService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class Test1 {
    /*public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-config.xml");
        MenuService menuService = (MenuService) context.getBean("menuService");
        menuService.makeMenu();
        *//*Test test = (Test)context.getBean("Test");
        System.out.println(test.getId());*//*
    }*/
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-config.xml");
        MenuService menuService = (MenuService) context.getBean("menuService");
        List<Menu> menuList = menuService.selectMenu();
        System.out.println("编号-------------->菜品名称-------------->菜品价格");
        menuList.forEach(menu -> System.out.println(menu.getmId() + "-------------->" + menu.getmName() + "-------------->" + menu.getmPrice()));
    }
}
